﻿using EntityFrameworkCore.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Text;

namespace EntityFrameworkCore.Configurations
{
    public class SysyModuleConfigurations : EntityFrameworkCore.Mapping.EntityMappingConfiguration<SysyModule>
    {
    

        public override void Map(EntityTypeBuilder<SysyModule> builder)
        {

            base.MapCommon(builder);
            builder.Property(b => b.ParentId);
            builder.Property(b => b.Name).HasColumnType("nvarchar(10)").IsRequired(true);
            builder.Property(b => b.LinkUrl).HasColumnType("nvarchar(10)").IsRequired(true);
            builder.Property(b => b.Area).HasColumnType("nvarchar(50)").IsRequired(false);
            builder.Property(b => b.Action).IsRequired(false);
            builder.Property(b => b.Icon).HasColumnType("nvarchar(100)").IsRequired(false);
            builder.Property(b => b.Code).HasColumnType("nvarchar(20)").IsRequired(false);
            builder.Property(b => b.OrderSort).HasDefaultValue(0);
            builder.Property(b => b.Description).HasColumnType("nvarchar(1000)").IsRequired(false);
            builder.Property(b => b.IsEnabled).HasDefaultValue(true);
            builder.ToTable("SysyModules");
        }

     
    }
}
